<?php
/*
	消息通知设置
	参数：$msgtype,$text,$tpldata,$uid,$url,$color
*/
defined('BY_JYA') or exit('error');
list($msgtype,$uid,$o_id,$order_id)=$arguments;
$member=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),array('credit1','credit2','mobile','groupid','avatar','nickname'));
$order=pdo_get('jy_xiuvote_redorder',array('id'=>$order_id,'uniacid'=>$_SESSION['uniacid']));
$adminuid = $this->plugin_setting('basic')['adminuid'];
$basic=$this->plugin_setting('basic');
if($msgtype == 'setred'){
	$url=custom_url('jy_xiuvote/home/fred/',true);
	$tpldata=array(
		'first'=>array('value'=>'您好，您发出一个红包！','color'=>''),
		'remark'=>array('value'=>'查看红包信息~!','color'=>'#ff510'),
	);
	$url2=custom_url('jy_xiuvote/home/sred/',true);
	$newsmsg['msgtype']='news';
	$articles[0]['title'] = "您好，您收到一个红包！\n";
	$articles[0]['description']='查看红包信息~!';
	$articles[0]['url'] =$url2;
	$newsmsg['news']['articles'] =$articles;
	$this->send_message('getred',$newsmsg,$tpldata,$order['omid'],$url2,$color);
}elseif($msgtype == 'buyvip'){
	$url=custom_url('jy_xiuvote/home/',true);
	$tpldata=array(
		'first'=>array('value'=>'您好，有一条购买VIP消息！','color'=>''),
		'remark'=>array('value'=>$member['nickname'].'-刚刚购买了VIP，点击查看VIP购买记录~!','color'=>'#ff510'),
	);
	$url2=custom_url('jy_xiuvote/home/viplog/',true);
	$newsmsg['msgtype']='news';
	$articles[0]['title'] = "您好，有一条购买VIP消息！\n";
	$articles[0]['description']=$member['nickname'].'-刚刚购买了VIP，点击查看VIP购买记录~!';
	$articles[0]['url'] =$url2;
	$articles[0]['picurl']=$member['avatar'];
	$newsmsg['news']['articles'] =$articles;
	$this->send_message('getvip',$newsmsg,$tpldata,$adminuid,$url2,$color);
	
}

$this->send_message($msgtype,$newsmsg,$tpldata,$uid,$url,$color);